package com.wzh.dao;

import com.wzh.pojo.Knowledge;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface knowledgeDao {

    @Select("select * from knowledge")
    List<Knowledge> getAll();

    @Insert("insert into knowledge values (#{name},NOW())")
    int insert(Knowledge knowledge);

    @Delete("delete from knowledge where name = #{name}")
    int delete(String name);

}
